hex_pattern.cpp